﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Views/Shared/Admin.Master" Inherits="System.Web.Mvc.ViewPage<CourseSystem.Core.Entities.CommonResourcesInfo>" %>

<%@ Import Namespace="CourseSystem.Common.Helpers" %>
<asp:Content ID="Content1" ContentPlaceHolderID="TitleContent" runat="server">
    视频资源编辑
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="MainContent" runat="server">
    <% Html.RenderPartial("AdminTopUc", "视频资源编辑"); %>
    <table width="100%" height="5" border="0" cellpadding="0" cellspacing="0" bordercolor="#FFFFFF">
        <tr>
            <td height="5" bgcolor="#FFFFFF">
            </td>
        </tr>
    </table>
    <% using (Html.BeginForm("CommonEdit", "AdminResources", new { Model.Id }, FormMethod.Post, new { enctype = "multipart/form-data" }))
       {%>
    <fieldset>
        <%=Html.HiddenFor(o=>o.Type) %>
        <div class="editor-label">
            <%: Html.LabelFor(model => model.MinType)%>
        </div>
        <div class="editor-field">
            <%: Html.DropDownListFor(model => model.MinType, ResourcesHelper.GetTextType())%>
            <%: Html.ValidationMessageFor(model => model.MinType)%>
        </div>
        <div class="editor-label">
            <%: Html.LabelFor(model => model.Title) %>
        </div>
        <div class="editor-field">
            <%: Html.TextBoxFor(model => model.Title) %>
            <%: Html.ValidationMessageFor(model => model.Title) %>
        </div>
        <div class="editor-label">
            <%: Html.LabelFor(model => model.Introduction) %>
        </div>
        <div class="editor-field">
            <%: Html.TextBoxFor(model => model.Introduction,new{@class="longText"})%>
            <%: Html.ValidationMessageFor(model => model.Introduction)%>
        </div>
        <div class="editor-label">
            <%: Html.LabelFor(model => model.Author) %>
        </div>
        <div class="editor-field">
            <%: Html.TextBoxFor(model => model.Author) %>
            <%: Html.ValidationMessageFor(model => model.Author) %>
        </div>
        <div class="editor-label">
            <%: Html.LabelFor(model => model.Source) %>
        </div>
        <div class="editor-field">
            <%: Html.TextBoxFor(model => model.Source)%>
            <%: Html.ValidationMessageFor(model => model.Source)%>
        </div>
        <div class="editor-label">
            <%: Html.LabelFor(model => model.Keyword) %>
        </div>
        <div class="editor-field">
            <%: Html.TextBoxFor(model => model.Keyword)%>
            <%: Html.ValidationMessageFor(model => model.Keyword)%>
        </div>
        <div class="editor-label">
            <%: Html.LabelFor(model => model.IsCanDownload) %>
        </div>
        <div class="editor-field">
            <%: Html.CheckBoxFor(model => model.IsCanDownload)%>
            <%: Html.ValidationMessageFor(model => model.IsCanDownload)%>
        </div>
        <div class="editor-label">
            <%: Html.LabelFor(model => model.CoverImg) %>
        </div>
        <div class="editor-field">
            <% if (string.IsNullOrEmpty(Model.CoverImg))
               {
                   Model.CoverImg = "Content/images/videoCover.jpg";
               } %>
            <img src="<%=Url.Content("~/"+Model.CoverImg) %>" width="206" height="168"  />
            <br />
            <input type="file" name="UpFileCover" />
            <%: Html.ValidationMessageFor(model => model.CoverImg)%>
        </div>
        <div class="editor-label">
            <label>
                视频</label>
        </div>
        <div class="editor-field">
            <% if (!string.IsNullOrEmpty(Model.FileName))
               { %>
            <%= ResourcesHelper.GetHtml(Model.FileName, Model.Type) %><br />
            <% } %>
            <input type="file" name="UpFile" />
            <%: Html.ValidationMessageFor(model => model.FileName) %>
        </div>
        <% if (!string.IsNullOrEmpty(Model.FileName))
           { %>
        <div class="editor-label">
            <label>
                本资源地址</label>
        </div>
        <div class="editor-field">
            <%=CommonHelper.Domain + Model.FileName%>
        </div>
        <%} %>
        <p>
            <input type="submit" value="保存" /><%=Html.ActionButton("返回", "Common",new{type=Model.Type})%>
        </p>
    </fieldset>
    <% } %>
</asp:Content>
<asp:Content ID="Content3" ContentPlaceHolderID="HeaderContent" runat="server">
</asp:Content>
